package com.example.demo.mvvm.ui.activity;

import android.view.View;

import com.example.demo.mvvm.BR;
import com.example.demo.mvvm.R;
import com.example.demo.mvvm.databinding.ActivityChildrenBinding;
import com.example.demo.mvvm.ui.base.BaseActivity;
import com.example.demo.mvvm.ui.vm.activity.ChildrenActivityVm;

public class ChildrenActivity extends BaseActivity<ActivityChildrenBinding , ChildrenActivityVm> {

    @Override
    protected void init() {
        setSupportActionBar(databing.toolBar);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        databing.toolBar.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
    }

    @Override
    public int getLayoutId() {
        return R.layout.activity_children;
    }

    @Override
    public int getVariableId() {
        return BR.viewModel;
    }

    @Override
    public ChildrenActivityVm getViewModel() {
        return new ChildrenActivityVm( databing , getIntent() , getSupportFragmentManager() , getSupportActionBar());
    }
}
